package cz.muni.fi.pa165.hauntedhouses.ejb;

import cz.muni.fi.pa165.hauntedhouses.entity.Ability;
import java.util.List;
import javax.ejb.Local;

/**
 *
 * @author Matěj Novotný
 */
@Local
public interface AbilityServiceEJBLocal {
    public static final String JNDI = "ejblocal:cz.muni.fi.pa165.hauntedhouses.ejb.AbilityServiceEJBLocal";
    /** 
     * Checks if given Ability is correct and stores it into the DB
     *
     * @param ability ability entity we want to add to database
     * @throws IllegalArgumentException if entity itself or any of its attributes
     * is null or, in case of strings, empty. Also throws this exception in case the Ability has
     * already assigned ID.
     */
    void create(Ability ability);
    
    /**
     * Checks if given Ability is correct and present is the database, if so, this
     * Ability will be removed.
     *
     * @param ability the ability we want to remove
     * @throws IllegalArgumentException if entity itself or any of its attributes
     * is null or, in case of strings, empty.
     */
    void remove(Ability ability);
    
    /**
     * Returns a Ability from the DB based on its ID. If there is no Ability with
     * such ID, null is returned.
     *
     * @param id id of a Ability we want to search in the DB
     * @return null if there is no Ability with given ID, Ability otherwise
     * @throws IllegalArgumentException if id is null or < 0
     */
    Ability get(Long id);
    
     /**
      * Returns list of all the abilities in the DB. If there are no abilities, empty list
     * is returned
     *
     * @return List of all abilities. Empty list of there are no abilities.
     */
    List<Ability> findAll();
    
    
}
